/// <reference path="../types.ts" />
/// <reference path="../helpers.ts" />
/// <reference path="organization.ts" />

module $Xrm.Messages {
    export class SetStateRequest extends OrganizationRequest {
        public EntityMoniker: $Xrm.EntityReference = null;
        public State: $Xrm.OptionSetValue = null;
        public Status: $Xrm.OptionSetValue = null;

        constructor() {
            super("SetState", "b"); // namespace is 'b' because this request is from crm4 days
        }

        GetResponse(responseXml: Document): SetStateResponse {
            return new SetStateResponse(responseXml);
        }

        ToSoapXml(): string {
            this.Parameters["EntityMoniker"] = this.EntityMoniker;
            this.Parameters["State"] = this.State;
            this.Parameters["Status"] = this.Status;

            return super.ToSoapXml();
        }
    }

    export class SetStateResponse extends OrganizationResponse {
        constructor(responseXml?: Document) {
            super("SetState", responseXml);
        }
    }
}